Conventionally, techniques for eliminating the inclination of a camera have been proposed. In such techniques, an inclination of a camera is reduced by extracting edges in an image, and then, assuming that the inclination of an edge having the largest length is the inclination of the camera, affine transform is performed to image data to eliminate the inclination of the edge having the largest length (e.g., see Patent Reference 1).
Moreover, a technique for extracting a vertical edge in an image and detecting an inclination of the image from the vertical edge is disclosed in Non-patent Reference 1.
(Patent Reference 1) Japanese Laid-Open Publication No. 4-314274 (Page 2, FIG. 1)
(Non-patent Reference 1) Hidekazu Ohmi and Fumihiko Saitoh, “Image Inclination Measurement Based on Edge Directions and an Analysis of Relation between Visual Inclination”, MVA2002 IAPR Workshop on Machine Vision Application, Dec. 11-13, 2002.